Sum all the itemsΒΆ

Sum all the items in a list.
def sum_list(L):
    sum_numbers = 0
    for x in L:
        sum_numbers += x
    return sum_numbers

# test
print(sum_list([1, 2, -8]))    # -5